package cn.ac.jaas.ljx.wordsegmentation.domain;

public class Word {

	private String value;
	private int time = 0;
	private String nature;
	
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public int getTime() {
		return time;
	}
	public void setTime(int time) {
		this.time = time;
	}
	public String getNature() {
		return nature;
	}
	public void setNature(String nature) {
		this.nature = nature;
	}
	
	public Word() {
		super();
		this.time = 1;
	}
	public Word(String value) {
		super();
		this.time = 1;
		this.value = value;
	}
	public Word(String value, String nature) {
		super();
		this.time = 1;
		this.value = value;
		this.nature = nature;
	}
	@Override
	public String toString() {
		return "value=" + value + ", time=" + time + ", nature=" + nature + ";";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((value == null) ? 0 : value.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Word) {
			Word word = (Word) obj;
			return this.value.equals(word.value);
		}
		return super.equals(obj);
	}
	
}
